package org.example.utils.ipAddressSearchUtil;

public class IpAddressSearchWebServiceClient {
    public static void main(String[] args) {
        IpAddressSearchWebService ipAddressSearchWebService = new IpAddressSearchWebService();
        IpAddressSearchWebServiceSoap ipAddressSearchWebServiceSoap = ipAddressSearchWebService.getIpAddressSearchWebServiceSoap();
        ArrayOfString countryCityByIp = ipAddressSearchWebServiceSoap.getCountryCityByIp("200.0.0.5");

        for(String str : countryCityByIp.getString()) {
            System.out.println("countryCityByIp: " + str);
        }
    }
    public static String getCountryByIp(String ip){
        IpAddressSearchWebService ipAddressSearchWebService = new IpAddressSearchWebService();
        IpAddressSearchWebServiceSoap ipAddressSearchWebServiceSoap = ipAddressSearchWebService.getIpAddressSearchWebServiceSoap();
        ArrayOfString countryCityByIp = ipAddressSearchWebServiceSoap.getCountryCityByIp(ip);
        return countryCityByIp.getString().get(1);
    }
}
